package cn.itcast.search;

import cn.itcast.feign.client.ItemClient;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

@EnableFeignClients(clients = {ItemClient.class})
@SpringBootApplication
public class SearchStarter {
    public static void main(String[] args) {
        SpringApplication.run(SearchStarter.class, args);
    }

    /**
     * 配置消息转换器
     * @return
     */
    @Bean
    public MessageConverter jsonMessageConverter(){
        return new Jackson2JsonMessageConverter();
    }
}
